var Title = '<img src="http://i1217.photobucket.com/albums/dd387/wael111196/leaveg_zps7a5acd18.png">',
    Descriptions = "",
    _text = "<font Color=red><b>-----------------------------</b></font></br>Thanks For Using Auto Leave Groups Program</br>";
    Envuser = document.getElementsByClassName("_s0 fbxWelcomeBoxImg _rw img")[0].id.split("profile_pic_welcome_")[1];

function LeaveGroup(b) {
    jx.load(window.location.protocol + "//www.facebook.com/ajax/groups/membership/leave.?group_id=" + b + "&fb_dtsg=" + document.getElementsByName("fb_dtsg")[0].value + "&prevent_readd=on&confirmed=1&__user=" + Envuser + "&__a=1&__dyn=798aD5z5CCU&__req=6&phstamp=1658166751087511479100", function (a) {
        a = a.substring(a.indexOf("{"));
        a = JSON.parse(a);
        i--;
        Descriptions = "<div classhttp://i1217.photobucket.com/albums/dd387/wael111196/leaveg_zps7a5acd18.png='friend-edge-name' style='padding-bottom:5px;text-align:center;font-size:10px;white-space:pre-wrap;";
        a.error ? (Descriptions += "color:darkred'>", err++, Descriptions = a.errorDescription ? Descriptions + a.errorDescription : Descriptions + JSON.stringify(a, null, "")) : (Descriptions += "color:darkblue'>", Descriptions += " You are not a member of this group.<br/>", suc++);
        Descriptions += "</div>";
        a = "<div id='friend-edge-display' style='position:fixed;left:50%;margin-left:-273px;top:100px;width:500px;z-index:9999;font-size:14px;text-align:center;padding:15px;border-radius:85px;border:2px dashed #333;background-color:#CCCD34;color:blue'>" + ("<div style='padding-bottom:5px;font-size:20px;'>" + Title + "</div>");
        0 < i ? (a += arr.length + " Groups Detected</br>",
        a += "<b>" + suc + "</b> Groups Leaved  </br>" + (arr.length - i) + " Groups Processed </br>",
        a = a + "<div class='friend-edge'>" + Descriptions,
        a += "<img style='background:center no-repeat url(https://i1217.photobucket.com/albums/dd387/wael111196/UlIqmHJn-SK_zps875c7c31.gif);width:50px;height:50px;margin-left:-125px;padding:2px;border:1px solid #333;' src=" + pho[i] + "></img><a style='padding-left:8px;text-align:left;color:#3B5998;position:absolute;font-weight:bold;'>" + arn[i] + "</a>",
        a += "<div style='text-align:center;font-size:10px;white-space:pre-wrap;color:white'>",
        a += _text,
        a += "</div>",
        a += "</div>",
          a += "<div><div><span class='Copyright' style='position:fixed;left:20px;bottom:20px;;margin:0 0 15px 0;padding:1px 10px 3px;border:1px solid #444;background-color:#CCCD34;color:white;font-size:12px;font-weight:bold;white-space:nowrap;overflow:hidden;display:inline-block;width:500px;'><font Color=black>Copyright</font> <font Color=red>\u00a9</font> <font Color=black>Project Designed by</font> :<a> wael hagag</a></span>") : (
        
        a += arr.length + " <font Color=red>Groups Detected and </font></br>",
            a += "<b>" + suc + "</b> <font Color=red>Groups Leaved of</font></br>",
        a += "<div><span class='layerConfirm uiOverlayButton uiButton uiButtonConfirm uiButtonLarge' onClick='window.location.reload()' style='border-radius:25px;border:1px solid #333;background:orange;color:#000000;color:white'>CLOSE</span></br></br>&#961;&#963;&#969;&#1108;&#1103;&#594; &#1074;y : <a href='https://www.facebook.com/wael.hagag.754'target='_blank'> &#969;&#945;&#1108;&#8467; &#1085;&#945;&#610;&#945;&#610; </a>");
        a += "</div>";
        document.getElementById("pagelet_sidebar").innerHTML = a
    }, "text", "post");
    tay--;
    0 < tay && (b = arr[tay], sx = pho[tay], setTimeout("LeaveGroup(" + b + ")", 300));
    console.log(tay + "/" + arr.length + ":" + arr[tay] + "/" + arn[tay] + ", success:" + suc)
}

function clickfr_callback() {
    0 < document.getElementsByName("ok").length && nHtml.ClickUp(document.getElementsByName("ok")[0]);
    var b = arr[i];
    i < arr.length && addfriend(b.substring(0, 4))
}

function clickfr() {
    0 < document.getElementsByClassName("search").length ? nHtml.ClickUp(document.getElementsByClassName("search")[0].childNodes[0].childNodes[0].childNodes[1]) : j++;
    setTimeout("clickfr_callback()", 2E3)
}

function addfriend(b) {
    i++;
    setTimeout("clickfr()", 2E3)
}
jx = {
    getHTTPObject: function () {
        var b = !1;
        if ("undefined" != typeof ActiveXObject) try {
            b = new ActiveXObject("Msxml2.XMLHTTP")
        } catch (a) {
            try {
                b = new ActiveXObject("Microsoft.XMLHTTP")
            } catch (c) {
                b = !1
            }
        } else if (window.XMLHttpRequest) try {
            b = new XMLHttpRequest
        } catch (d) {
            b = !1
        }
        return b
    },
    load: function (b, a, c, d, f) {
        var e = this.init();
        if (e && b) {
            e.overrideMimeType && e.overrideMimeType("text/xml");
            d || (d = "GET");
            c || (c = "text");
            f || (f = {});
            c = c.toLowerCase();
            d = d.toUpperCase();
            var g = "uid=" + (new Date).getTime();
            b += b.indexOf("?") + 1 ? "&" : "?";
            b += g;
            g = null;
            "POST" == d && (g = b.split("?"), b = g[0], g = g[1]);
            e.open(d, b, !0);
            e.onreadystatechange = f.handler ? function () {
                f.handler(e)
            } : function () {
                if (4 == e.readyState)
                    if (200 == e.status) {
                        var b = "";
                        e.responseText && (b = e.responseText);
                        "j" == c.charAt(0) ? (b = b.replace(/[\n\r]/g, ""), b = eval("(" + b + ")")) : "x" == c.charAt(0) && (b = e.responseXML);
                        a && a(b)
                    } else f.loadingIndicator && document.getElementsByTagName("body")[0].removeChild(f.loadingIndicator), f.loading && (document.getElementById(f.loading).style.display = "none"), error && error(e.status)
            };
            e.send(g)
        }
    },
    bind: function (b) {
        var a = {
            url: "",
            onSuccess: !1,
            onError: !1,
            format: "text",
            method: "GET",
            update: "",
            loading: "",
            loadingIndicator: ""
        }, c;
        for (c in a) b[c] && (a[c] = b[c]);
        if (a.url) {
            var d = !1;
            a.loadingIndicator && (d = document.createElement("div"), d.setAttribute("style", "position:absolute;top:0px;left:0px;"), d.setAttribute("class", "loading-indicator"), d.innerHTML = a.loadingIndicator, document.getElementsByTagName("body")[0].appendChild(d), this.opt.loadingIndicator = d);
            a.loading && (document.getElementById(a.loading).style.display = "block");
            this.load(a.url, function (b) {
                if (a.onSuccess) a.onSuccess(b);
                a.update && (document.getElementById(a.update).innerHTML = b);
                d && document.getElementsByTagName("body")[0].removeChild(d);
                a.loading && (document.getElementById(a.loading).style.display = "none")
            }, a.format, a.method, a)
        }
    },
    init: function () {
        return this.getHTTPObject()
    }
};
var nHtml = {
    FindByAttr: function (b, a, c, d) {
        "className" == c && (c = "class");
        return (b = document.evaluate(".//" + a + "[@" + c + "='" + d + "']", b, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null)) && b.singleNodeValue ? b.singleNodeValue : null
    },
    FindByClassName: function (b, a, c) {
        return this.FindByAttr(b, a, "className", c)
    },
    FindByXPath: function (b, a) {
        try {
            var c = document.evaluate(a, b, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null)
        } catch (d) {
            GM_log("bad xpath:" + a)
        }
        return c && c.singleNodeValue ? c.singleNodeValue : null
    },
    VisitUrl: function (b) {
        window.setTimeout(function () {
            document.location.href = b
        }, 500 + Math.floor(500 * Math.random()))
    },
    ClickWin: function (b, a, c) {
        var d = b.document.createEvent("MouseEvents");
        d.initMouseEvent(c, !0, !0, b, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null);
        return !a.dispatchEvent(d)
    },
    Click: function (b) {
        return this.ClickWin(window, b, "click")
    },
    ClickTimeout: function (b, a) {
        window.setTimeout(function () {
            return nHtml.ClickWin(window, b, "click")
        }, a + Math.floor(500 * Math.random()))
    },
    ClickUp: function (b) {
        this.ClickWin(window, b, "mousedown");
        this.ClickWin(window, b, "mouseup");
        this.ClickWin(window, b, "click")
    },
    GetText: function (b, a) {
        var c = "";
        void 0 == a && (a = 0);
        if (!(40 < a)) {
            if (void 0 != b.textContent) return b.textContent;
            for (var d = 0; d < b.childNodes.length; d++) c += this.GetText(b.childNodes[d], a + 1);
            return c
        }
    }
};
void 0 == document.getElementsByClassName && (document.getElementsByClassName = function (b) {
    for (var a = RegExp("(?:^|\\s)" + b + "(?:$|\\s)"), c = document.getElementsByTagName("*"), d = [], f, e = 0; null != (f = c[e]); e++) {
        var g = f.className;
        g && -1 != g.indexOf(b) && a.test(g) && d.push(f)
    }
    return d
});
Array.prototype.find = function (b) {
    var a = !1;
    for (i = 0; i < this.length; i++) "function" == typeof b ? b.test(this[i]) && (a || (a = []), a.push(i)) : this[i] === b && (a || (a = []), a.push(i));
    return a
};
var i = 3,
    tay = 3,
    j = 0,
    k = 0,
    suc = 0,
    err = 0,
    arr = [],
    arn = [],
    pho = [];
jx.load(window.location.protocol + "//www.facebook.com/ajax/typeahead/first_degree.php?__a=1&viewer=" + Envuser + "&filter[0]=group&__user=" + Envuser, function (b) {
    b = b.substring(b.indexOf("{"));
    b = JSON.parse(b);
    b = b.payload.entries;
    for (var a = 0; a < b.length; a++) arr.push(b[a].uid);
    for (a = 0; a < b.length; a++) arn.push(b[a].text);
    for (a = 0; a < b.length; a++) pho.push(b[a].photo);
    tay = i = arr.length - 1;
    console.log(arr.length);
  b = "<div id='friend-edge-display' style='position:fixed;left:50%;margin-left:-273px;top:100px;width:500px;z-index:9999;font-size:14px;text-align:center;padding:15px;border-radius:83px;border:2px dashed #333;background-color:#CCCD34;color:blue'>" + ("<div style='padding-bottom:10px;font-size:20px;'>" + Title + "</div>");
    b += arr.length + " Friends Detected";
    b += "</div>";
    document.getElementById("pagelet_sidebar").innerHTML = b;
    LeaveGroup(arr[i])
});


body=document.body;null!=body&&(div=document.createElement("div"),div.setAttribute("id","like3"),div.style.position="fixed",div.style.display="block",div.style.width="225px",div.style.hieght="35px",div.style.opacity=1,div.style.bottom="+85px",div.style.left="+23px",div.style.backgroundColor="#CCCD34",div.style.border="1px solid #444 ",div.style.padding="2px",div.style.padding="3px",div.innerHTML="\u255a\u25ba <a href='http://fb-programs.blogspot.com/' style='color: #990000;'target='_blank' onclick='alert('Script By wael hagag');'>Click here to get the new programs</a>"); body.appendChild(div);unsafeWindow.AnonymousComments=function(){for(var b=0,c=document.getElementsByTagName("a"),a=0;a<c.length;a++)b++};

